<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="<%=request.getContextPath()%>/">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>支付成功 - 医疗预约系统</title>
    <link rel="stylesheet" href="statics/css/hisStyle.css">
    <style>
        /* 统一的样式变量 - 与支付页面保持一致 */
        :root {
            --primary-color: #3498db;
            --primary-hover: #2980b9;
            --secondary-color: #95a5a6;
            --secondary-hover: #7f8c8d;
            --success-color: #27ae60;
            --error-color: #e74c3c;
            --text-primary: #2c3e50;
            --text-secondary: #7f8c8d;
            --bg-light: #f8f9fa;
            --bg-white: #ffffff;
            --border-color: #ddd;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            --border-radius: 8px;
        }
        
        /* 全局样式 */
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f5f7fa;
            margin: 0;
            padding: 0;
        }
        
        /* 头部样式 */
        .header {
            background-color: var(--text-primary);
            color: white;
            padding: 20px 0;
            margin-bottom: 30px;
        }
        
        .header-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }
        
        /* 容器样式 */
        .container {
            max-width: 600px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        /* 成功容器 */
        .success-container {
            background: var(--bg-white);
            border-radius: 10px;
            padding: 40px;
            box-shadow: var(--shadow);
            text-align: center;
        }
        
        /* 成功图标 */
        .success-icon {
            font-size: 64px;
            color: var(--success-color);
            margin-bottom: 20px;
            animation: pulse 1s ease-in-out;
        }
        
        /* 成功标题 */
        .success-title {
            color: var(--text-primary);
            font-size: 28px;
            margin-bottom: 10px;
            font-weight: bold;
        }
        
        /* 成功消息 */
        .success-message {
            color: var(--text-secondary);
            font-size: 16px;
            margin-bottom: 30px;
            line-height: 1.6;
        }
        
        /* 订单信息 */
        .order-info {
            background-color: var(--bg-light);
            padding: 20px;
            border-radius: var(--border-radius);
            margin-bottom: 30px;
            text-align: left;
        }
        
        .order-info h3 {
            color: var(--text-primary);
            margin-bottom: 15px;
            font-size: 18px;
            text-align: center;
        }
        
        .order-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }
        
        .detail-item {
            color: var(--text-secondary);
            line-height: 1.6;
        }
        
        .detail-item strong {
            color: var(--text-primary);
        }
        
        /* 按钮样式 - 与支付页面保持一致 */
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            font-weight: bold;
            transition: all 0.3s ease;
            margin: 0 10px;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: var(--primary-hover);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
        }
        
        .btn-secondary {
            background-color: var(--secondary-color);
            color: white;
        }
        
        .btn-secondary:hover {
            background-color: var(--secondary-hover);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(149, 165, 166, 0.3);
        }
        
        /* 按钮组 */
        .btn-group {
            margin-top: 20px;
        }
        
        /* 动画效果 */
        @keyframes pulse {
            0% {
                transform: scale(0.8);
                opacity: 0.5;
            }
            50% {
                transform: scale(1.1);
                opacity: 1;
            }
            100% {
                transform: scale(1);
                opacity: 1;
            }
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .order-details {
                grid-template-columns: 1fr;
            }
            
            .btn {
                display: block;
                width: 100%;
                margin: 10px 0;
            }
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="header-content">
            <h1>医疗预约系统</h1>
            <c:choose>
                <c:when test="${not empty sessionScope.loginUser}">
                    <span>欢迎，${sessionScope.loginUser.username}</span>
                </c:when>
                <c:otherwise>
                    <a href="auth/login" class="btn btn-primary">登录</a>
                    <a href="auth/register" class="btn btn-secondary" style="margin-left: 10px;">注册</a>
                </c:otherwise>
            </c:choose>
        </div>
    </div>

    <div class="container">
        <div class="success-container">
            <div class="success-icon">✅</div>
            <div class="success-title">支付成功！</div>
            <div class="success-message">您的预约已确认，请按时就诊</div>

            <div class="order-info">
                <h3>订单信息</h3>
                <div class="order-details">
                    <div class="detail-item">
                        <strong>订单号：</strong>${orderNo}
                    </div>
                    <div class="detail-item">
                        <strong>支付时间：</strong>${sessionScope.payTime}
                    </div>
                    <div class="detail-item">
                        <strong>支付状态：</strong>已支付
                    </div>
                </div>
            </div>

            <div class="btn-group">
                <a href="frontend/my-appointments" class="btn btn-primary">查看我的预约</a>
                <a href="frontend/index" class="btn btn-secondary">返回首页</a>
            </div>
        </div>
    </div>
</body>
</html>
